# utils/logger.py
import logging
from config import LOG_PATH

# 如果 LOG_PATH 为空，输出到控制台，否则输出到文件
if not LOG_PATH:
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s %(levelname)s %(message)s'
    )
else:
    logging.basicConfig(
        filename=LOG_PATH,
        level=logging.INFO,
        format='%(asctime)s %(levelname)s %(message)s'
    )
logger = logging.getLogger(__name__)
    